package com.car.controller;

import com.car.common.Result;
import com.car.service.StatisticsService;
import com.car.vo.StatisticsVO;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 统计控制器
 *
 * @author Car System
 */
@Tag(name = "统计分析")
@RestController
@RequestMapping("/statistics")
@RequiredArgsConstructor
public class StatisticsController {

    private final StatisticsService statisticsService;

    @Operation(summary = "获取统计数据")
    @GetMapping
    public Result<StatisticsVO> getStatistics() {
        StatisticsVO statistics = statisticsService.getStatistics();
        return Result.success(statistics);
    }
}

